<?php

class Trip extends CI_Controller {

    var $_public_view;

    function __construct() {
        parent::__construct();
        $this->load->model('model_perjalanan', 'mtrip');
        $this->load->helper('url');
        $this->load->library('session');
        $this->config->load('ojexcom');
        $this->_public_view = $this->config->item('public_view');
    }

    function index() {
        //echo 'lalala1 ';
        $data = array('page_content'=>'trip');
        $this->load->view($this->_public_view, $data);
     }

     function cek(){
     	$sql = "SELECT trip.source_label, trip.destination_label, user.name, trip.departTime,
                        trip.via, trip.priceInRupiah, trip.priceInPoint, trip.id as tripId, user.id,
                        trip.status
                from trip,user
                where user.id = trip.userId order by tripId desc limit 5";
        $query = $this->db->query($sql);
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $value) {
                $a[] = $value;
                echo $value->name.'<br/>';
            }
        }
     }

}

?>
